﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QuestionManager
{
    class GetBussiness
    {
        private static GetBussiness instance;
        public static GetBussiness getInstace()
        {
            if (instance == null) instance = new GetBussiness();
            return instance;
        }

        public List<Diffculty> GetDiffculty()
        {
            List<Diffculty> Diffculty = new List<Diffculty>();
            Diffculty.Add(new Diffculty(1, "Easy"));
            Diffculty.Add(new Diffculty(2, "Medium"));
            Diffculty.Add(new Diffculty(3, "Hard"));

            return Diffculty;
        }

        public List<Course> GetCourse()
        {
            List<COURSE> CourseList = BussinessLogicLayer.BLL_Course.LoadAll();
            if (CourseList != null)
            {
                List<Course> _list = new List<Course>();
                foreach (COURSE item in CourseList)
                {
                    Course tmp = new Course(item.COURSE_ID, item.COURSE_NAME);
                    _list.Add(tmp);
                }
                return _list;
            }
            return null;
        }

        public List<Time> GetTime()
        {
            List<Time> Time = new List<Time>();
            Time.Add(new Time(1, "1 min", 1000 * 60));
            Time.Add(new Time(2, "2 mins", 1000 * 60 * 2));
            Time.Add(new Time(3, "3 mins", 1000 * 60 * 3));

            return Time;
        }

        public List<Professor> GetProfessor()
        {
            List<USER> users = BussinessLogicLayer.BLL_User.LoadAll();
            List<Professor> Professors = new List<Professor>();
            if (users != null)
            {
                foreach (var user in users)
                {
                    Professor temp = new Professor(user.USER_ID, user.USER_FIRST_NAME +  " " +user.USER_LAST_NAME);
                    Professors.Add(temp);
                }
            }
            return Professors;
        }
    }
}
